import os

import pytest
import yamail,logging,time,json
t=time.strftime('%Y%m%d%H%M%S')
def lo():
    logging.basicConfig(filename='min.log',filemode='w',level=logging.DEBUG,format='%(filename)s %(msecs)d %(thread)d %(message)s')
def yj(f):
    am=yamail.SMTP(user='1391277593@qq.com',password='npphtjsegwjqhiae',host='smtp.qq.com')
    am.send(to='1391277593@qq.com',subject='测试报告',contents='今日报告请查收',attachments=f)
if __name__ == '__main__':
    lo()
    pytest.main(['-s','Testcat.py','--alluredir=./data','--clean-alluredir'])
    os.system('allure generate ./data -o ./bao --clean')
    yj(['min.log',r'D:\gaowu\pythonProject\gqingzy\bao\index.html'])